let form = layui.form;
function renderUser() {
    $.ajax({
        url: '/my/userinfo',
        success: function (res) {
            if (res.status === 0) {
                form.val('abc', res.data)
            }
        }
    })
}
renderUser()

$('form').on('submit', function (e) {
    e.preventDefault();
    let data = $(this).serialize();
    $.ajax({
        type: 'post',
        url: '/my/userinfo',
        data,
        success: function (res) {
            layer.msg(res.message);
            if (res.status === 0) {
                window.parent.getUserInfo();
            }
        }
    })
})

$('button:contains("重置")').on('click', function (e) {
    e.preventDefault();
    renderUser()
})